<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;

Route::get('hello/:name', 'index/hello');

// 用户相关路由
Route::group('user', function () {
    Route::post('login', 'User/login');
    Route::get('info', 'User/info');
    Route::get('list', 'User/list');
    Route::get('getDepartmentLeaders', 'User/getDepartmentLeaders');
});

// 部门相关路由
Route::group('department', function () {
    Route::get('list', 'Department/list');
});

// 审批流程相关路由
Route::group('approvalflow', function () {
    Route::get('list', 'ApprovalFlow/list');
    Route::post('add', 'ApprovalFlow/add');
    Route::post('edit', 'ApprovalFlow/edit');
    Route::post('delete', 'ApprovalFlow/delete');
    Route::get('detail', 'ApprovalFlow/detail');
    Route::post('submit', 'ApprovalFlow/submit');
    Route::get('recordList', 'ApprovalFlow/recordList');
    Route::get('recordDetail', 'ApprovalFlow/recordDetail');
    Route::post('approve', 'ApprovalFlow/approve');
});

// 审批记录相关路由
Route::group('approvalrecord', function () {
    Route::post('submit', 'ApprovalRecord/submit');
    Route::get('getMyList', 'ApprovalRecord/getMyList');
    Route::get('getPendingList', 'ApprovalRecord/getPendingList');
    Route::post('process', 'ApprovalRecord/process');
    Route::post('cancel', 'ApprovalRecord/cancel');
    Route::get('detail', 'ApprovalRecord/detail');
});

// 我的审批相关路由
Route::group('myapprovals', function () {
    Route::get('getList', 'MyApprovals/getList');
    Route::post('process', 'MyApprovals/process');
    Route::get('detail', 'MyApprovals/detail');
});

// 补卡申请相关路由
Route::group('makeup_application', function () {
    Route::post('apply', 'MakeupApplication/apply');
    Route::get('getMyApplications', 'MakeupApplication/getMyApplications');
    Route::post('getMyApplications', 'MakeupApplication/getMyApplications');
    Route::post('getPendingApplications', 'MakeupApplication/getPendingApplications');
    Route::post('approve', 'MakeupApplication/approve');
    Route::post('cancel', 'MakeupApplication/cancel');
    Route::get('getStatistics', 'MakeupApplication/getStatistics');
});

// 补卡相关路由
Route::group('makeup', function () {
    Route::get('getMakeupConfig', 'MakeupController/getMakeupConfig');
    Route::get('getCurrentMonthUsage', 'MakeupController/getCurrentMonthUsage');
    Route::get('getCurrentMonthUsageDetail', 'MakeupController/getCurrentMonthUsageDetail'); // 调试接口
    Route::get('getMonthlyAbnormalRecords', 'MakeupController/getMonthlyAbnormalRecords');
    Route::post('applyMakeup', 'MakeupController/applyMakeup');
    Route::get('getMyApplications', 'MakeupController/getMyApplications');
});

// 位置测试路由（临时）
Route::get('locationTest/testLocation', 'LocationTest/testLocation');

// 公告相关路由
Route::group('notice', function () {
    Route::get('list', 'Notice/getList');
    Route::get('detail', 'Notice/getDetail');
    Route::get('categories', 'Notice/getCategories');
});
